<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>My Project: Inc/ris_protocol.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">My Project<span id="projectnumber">&#160;1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_f93dfce691d792349f1c14ede440e2e6.html">Inc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">ris_protocol.h</div></div>
</div><!--header-->
<div class="contents">
<a href="ris__protocol_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#ifndef __RIS_PROTOCOL_H</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#define __RIS_PROTOCOL_H</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span> </div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#pragma pack(1)</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="struct_r_i_s___mode__t.html">   22</a></span><span class="keyword">typedef</span> <span class="keyword">struct</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span>{</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span>    uint8_t id     :4;      <span class="comment">// 电机ID: 0,1...,13,14 15表示向所有电机广播数据(此时无返回)</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>    uint8_t status :3;      <span class="comment">// 工作模式: 0.锁定 1.FOC闭环 2.编码器校准 3.保留</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span>    uint8_t none   :1;      <span class="comment">// 保留位</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span>} <a class="code hl_struct" href="struct_r_i_s___mode__t.html">RIS_Mode_t</a>;   <span class="comment">// 控制模式 1Byte</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="struct_r_i_s___comd__t.html">   33</a></span><span class="keyword">typedef</span> <span class="keyword">struct</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>{</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span>    int16_t tor_des;        <span class="comment">// 期望关节输出扭矩 unit: N.m      (q8)</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>    int16_t spd_des;        <span class="comment">// 期望关节输出速度 unit: rad/s    (q8)</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>    int32_t pos_des;        <span class="comment">// 期望关节输出位置 unit: rad      (q15)</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>    int16_t k_pos;          <span class="comment">// 期望关节刚度系数 unit: -1.0-1.0 (q15)</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>    int16_t k_spd;          <span class="comment">// 期望关节阻尼系数 unit: -1.0-1.0 (q15)</span></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>    </div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>} <a class="code hl_struct" href="struct_r_i_s___comd__t.html">RIS_Comd_t</a>;   <span class="comment">// 控制参数 12Byte</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="struct_r_i_s___fbk__t.html">   47</a></span><span class="keyword">typedef</span> <span class="keyword">struct</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>{</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span>    int16_t  torque;        <span class="comment">// 实际关节输出扭矩 unit: N.m     (q8)</span></div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>    int16_t  speed;         <span class="comment">// 实际关节输出速度 unit: rad/s   (q8)</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>    int32_t  pos;           <span class="comment">// 实际关节输出位置 unit: rad     (q15)</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span>    int8_t   temp;          <span class="comment">// 电机温度: -128~127°C</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span>    uint8_t  MError :3;     <span class="comment">// 电机错误标识: 0.正常 1.过热 2.过流 3.过压 4.编码器故障 5-7.保留</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span>    uint16_t force  :12;    <span class="comment">// 足端气压传感器数据 12bit (0-4095)</span></div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span>    uint8_t  none   :1;     <span class="comment">// 保留位</span></div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>} <a class="code hl_struct" href="struct_r_i_s___fbk__t.html">RIS_Fbk_t</a>;   <span class="comment">// 状态数据 11Byte</span></div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span><span class="preprocessor">#pragma pack()</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span> </div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span><span class="comment">/* </span></div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span><span class="comment"> * Actuator Communication Reduced Instruction Set</span></div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span><span class="comment"> * Unitree robotics (c) .Co.Ltd. 2022 All Rights Reserved.</span></div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span><span class="comment"> */</span></div>
<div class="ttc" id="astruct_r_i_s___comd__t_html"><div class="ttname"><a href="struct_r_i_s___comd__t.html">RIS_Comd_t</a></div><div class="ttdoc">电机状态控制信息</div><div class="ttdef"><b>Definition</b> <a href="ris__protocol_8h_source.html#l00033">ris_protocol.h:34</a></div></div>
<div class="ttc" id="astruct_r_i_s___fbk__t_html"><div class="ttname"><a href="struct_r_i_s___fbk__t.html">RIS_Fbk_t</a></div><div class="ttdoc">电机状态反馈信息</div><div class="ttdef"><b>Definition</b> <a href="ris__protocol_8h_source.html#l00047">ris_protocol.h:48</a></div></div>
<div class="ttc" id="astruct_r_i_s___mode__t_html"><div class="ttname"><a href="struct_r_i_s___mode__t.html">RIS_Mode_t</a></div><div class="ttdoc">电机模式控制信息</div><div class="ttdef"><b>Definition</b> <a href="ris__protocol_8h_source.html#l00022">ris_protocol.h:23</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.7
</small></address>
</body>
</html>
